# This is a basic playbook

- name: dole out the generic configuration
  hosts: data-analysis01.phx2.fedoraproject.org
  user: root
  gather_facts: True

  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  pre_tasks:
  - include: "{{ tasks }}/yumrepos.yml"

  roles:
  - base
  - rkhunter
  - hosts
  - fas_client
  - nagios_client
  - collectd/base
  - sudo

  tasks:
  - include: "{{ tasks }}/2fa_client.yml"
  - include: "{{ tasks }}/motd.yml"

  handlers:
  - include: "{{ handlers }}/restart_services.yml"
  - include: "{{ handlers }}/semanage.yml"

- name: dole out the service-specific config
  hosts: data-analysis01.phx2.fedoraproject.org
  user: root
  gather_facts: True
  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
  handlers:
  - include: "{{ handlers }}/restart_services.yml"

  roles:
   - { role: nfs/client,  mnt_dir: '/srv/fedora_stats',  nfs_src_dir: 'fedora_stats' }
   - geoip

  tasks:
   - name: install needed packages
     yum: pkg={{ item }} state=present
     with_items:
       - httpd
       - mod_ssl
       - awstats
       - rsync
       - httpd-tools
       - openssh-clients
       - emacs-nox
       - emacs-git
       - git
       - bc
       - python-geoip-geolite2
##
